<?php

class Core_Form_User_Privacy extends RedCross_Form {
    public function __construct($options = null) {
        parent::__construct($options);
        $this->setName('set_privacy');
    }
    
    public function init() {
        $publicInfo = new Zend_Form_Element_Checkbox('is_public');
        $publicInfo->removeDecorator('HtmlTag');
        $publicInfo->removeDecorator('DtDdWrapper');
        $publicInfo->getDecorator('Label')->setOption('placement', 'APPEND')->setOption('tag', 'span');
        $publicInfo->setLabel('Jeg godtar at navnet og telefonnummeret mitt er synlig for andre medlemmer.');
        $hidden = new Zend_Form_Element_Hidden('submit_privacy');
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Lagre');
        $this->addElements(array($publicInfo, $hidden, $submit));
    }

    public function fillForm(Core_Model_Member $member)
    {
        $this->getElement('is_public')->setValue($member->is_public);
    }
}

?>
